package com.szt.sy.controller.api.open;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.szt.sy.controller.base.ApiBaseController;
import com.szt.sy.entity.blog.Notice;
import com.szt.sy.service.blog.notice.NoticeService;
import com.szt.sy.vo.rep.base.RepBaseVO;

/***
 * 接口-开放-通知
 * 
 * @author wwy
 *
 */
@RestController
@RequestMapping("api/open/notice")
public class ApiOpenNoticeController extends ApiBaseController {
	
	@Autowired
	private NoticeService noticeService;
	
	@PostMapping("list")
	public RepBaseVO<List<Notice>> noticeList() {
		RepBaseVO<List<Notice>> repVO = new RepBaseVO<>();
		Page<Notice> page = new Page<>(1, 5);
		List<Notice> dataList = noticeService.selectPage(page, new EntityWrapper<Notice>().orderBy("id", false))
				.getRecords();
		return repVO.setCommonSuccess().setData(dataList);
	}
	
}
